package com.zan.pattern.visitor;

/**
 * @Author Zan
 * @Create 2024/4/27 17:36
 * @Description : TODO(请用一句话描述该类的功能)
 * @ClassName: Client
 */
public class Client {
    public static void main(String[] args) {
        // 创建Home对象
        Home home = new Home();
        // 添加元素到home对象中
        home.add(new Cat());
        home.add(new Dog());

        // 创建主人对象
        Owner owner = new Owner();
        // 让主人喂食所有的宠物
        home.action(owner);

        Someone someone = new Someone();
        home.action(someone);
    }
}
